package service

import (
	"context"
	pb "wire/api/user"
	"wire/internal/biz"
)

type UserService struct {
	biz *biz.UserBiz
}

func NewUserService(biz *biz.UserBiz) *UserService {
	return &UserService{
		biz: biz,
	}
}

// Get
func (s *UserService) Get(ctx context.Context, req *pb.GetRequest) (*pb.UserInfo, error) {
	// time.Sleep(8 * time.Second)
	id, _ := s.biz.Get(ctx)
	return &pb.UserInfo{
		Id:     id,
		Name:   "苏无限",
		Age:    18,
		Status: 2,
	}, nil
}

// List
func (s *UserService) List(ctx context.Context, req *pb.ListRequest) (*pb.ListReply, error) {
	return &pb.ListReply{}, nil
}
